<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<TPOJ.Model.Solution>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Problem Status List
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
        
    <h2>Problem Status List</h2>

    <table>
        <tr>
            <th>
                Run ID
            </th>
            <th>
                User
            </th>
            <th>
                Problem
            </th>
            <th>
                Result
            </th>
            <th>
                Memory
            </th>
            <th>
                Time
            </th>
            <th>
                Language
            </th>
            <th>
                Code Length
            </th>
            <th>
                Submit Time
            </th>
        </tr>
    <% foreach (var item in Model) { %>
    
        <tr>
            <td>
                <%= Html.Encode(item.UniqueID) %>
            </td>
            <td>
                <%= Html.ActionLink(TPOJ.Web.Utils.GetUserName(item.AccountID), "Details", "Account", new { id = TPOJ.Web.Utils.GetUserName(item.AccountID) }, new { target = "_blank" })%>
            </td>
            <td>
                <%= Html.ActionLink(Html.Encode(item.Problem.UniqueID), "Details", "Problem", new { id = item.Problem.UniqueID }, new { target = "_blank" })%>
            </td>
            <td class="<%= TPOJ.Web.Utils.ResultCSS(item.Result) %>">
                <%= Html.Encode(TPOJ.Web.Utils.UserFriendlyResult(item.Result)) %>
            </td>
            <td>
                <%= Html.Encode(item.Memory) %>K
            </td>
            <td>
                <%= Html.Encode(item.Time) %>MS
            </td>
            <td>
                <%= Html.Encode(item.Language) %>
            </td>
            <td>
                <%= Html.Encode(item.CodeLength) %>B
            </td>
            <td>
                <%= Html.Encode(String.Format("{0:g}", item.DateTime))%>
            </td>
        </tr>
    
    <% } %>

    </table>

</asp:Content>

